#ifndef _NSA_SPI_H
#define _NSA_SPI_H

/* Media Types */
typedef enum {
    nsa_media_type_copper = 0,
    nsa_media_type_fiber = 1,
    nsa_media_type_internal_serdes = 2,
    nsa_num_media_types
} nsa_media_type;

typedef enum {
    nsa_10_half = 0,
    nsa_10_full = 1,
    nsa_100_half = 2,
    nsa_100_full = 3
} nsa_speed_duplex_type;

/* Flow Control Settings */
typedef enum {
    nsa_fc_none = 0,
    nsa_fc_rx_pause = 1,
    nsa_fc_tx_pause = 2,
    nsa_fc_full = 3,
    nsa_fc_default = 0xFF
} nsa_fc_type;

typedef enum {
    nsa_ms_hw_default = 0,
    nsa_ms_force_master,
    nsa_ms_force_slave,
    nsa_ms_auto
} nsa_ms_type;

#define AUTO_ALL_MODES      0


struct nsa_spi_hw {
    nsa_media_type media_type;
	nsa_fc_type fc;

    u_int32_t phy_id;
    u_int32_t phy_revision;
    u_int32_t phy_addr;
    u_int16_t phy_spd_default;
    u_int8_t mac_addr[6];
    u_int8_t perm_mac_addr[6];
    u_int8_t autoneg;
    u_int16_t autoneg_advertised;
    u_int8_t mdix;
    u_int8_t forced_speed_duplex;
    u_int8_t wait_autoneg_complete;
    int phy_reset_disable;
	int speed_downgraded;

	int get_link_status;
    int serdes_link_down;

	u_int32_t original_fc;

	int adaptive_ifs;
	int disable_polarity_correction;

	nsa_ms_type master_slave;
    nsa_ms_type original_master_slave;
};


struct nsa_spi {
	u_int16_t link_speed;
	u_int16_t link_duplex;
	u_int32_t tx_timeout_count;

	u_int8_t fc_autoneg;

    u_int8_t ifn; /* port index on nsa_adapter*/
	int rx_csum;
    struct nsa_dev *nsa;

	struct net_device *netdev;
	struct net_device_stats net_stats;

    /* PHY stuff */
//	struct phy_device *phydev;
//	struct mii_bus *mii_bus;
	int oldspeed;
	int oldduplex;
	int oldlink;

//  struct timer_list link_timer;
//  struct work_struct watchdog_task;
    struct nsa_spi_hw hw;
};

#endif /*_NSA_SPI_H*/
